import { defineConfig } from 'vite'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base:"./",
  resolve: {
    alias: {
      '~': resolve(__dirname, './'),
      '@': resolve(__dirname, './src')
    }
  },
  server: {
    proxy: {
      '/A2F': {
        target: 'http://127.0.0.1:10245',
        secure: false,
        changeOrigin: true
      }
    },
    proxy: {
      '/GPT': {
        target: 'http://127.0.0.1:8000',
        secure: false,
        changeOrigin: true,
        rewrite: path => path.replace(/^\/GPT/, '')
      }
    },
    proxy: {
      '/ALY': {
        target: 'https://nls-gateway-cn-shanghai.aliyuncs.com/stream/v1',
        secure: false,
        changeOrigin: true,
        rewrite: path => path.replace(/^\/ALY/, '')
      }
    },
    proxy: {
      '/webman': {
        target: 'http://127.0.0.1:8787',
        secure: false,
        changeOrigin: true,
        rewrite: path => path.replace(/^\/webman/, '')
      }
    }
  }
})

// proxy: {
//   '/A2F': {
//     target: 'http://127.0.0.1:10245',
//     secure: false,
//     changeOrigin: true,
//     rewrite: path => path.replace(/^\/A2F/, '')
//   }
// }